﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Objects.SqlClient;
using System.Data.Linq.SqlClient;
using System.Web.Mvc;
using Kunlun.Models;
using Kunlun.BusinessLogic;
namespace Kunlun.Areas.Store.Controllers
{
    [HandleError]
    public class PhotoBookController : Controller
    {
        //
        // GET: /Store/PhotoBook/
        KunLunEntities entities = new KunLunEntities();
        
        public ActionResult Index(int id)
        {

            List<Product> product =KunlunProduct.GetProductByCategoryID(id.ToString());

            ViewData["Category"]  = KunlunCategory.GetListByParentID(id);

            return View(product);
        }
        public ActionResult Views(string id)
        {
            var product = KunlunProduct.GetProductByID(id);
            ViewData["Interest"] = KunlunProduct.GetInterestProductByID(id);
            return View(product);
        }
       
        public ActionResult ChildCategory(int id)
        {
            List<Category> category = KunlunCategory.GetListByParentID(id);
            return PartialView(category);
        }
    }
}
